package jcommon.chap5_collection.iterator;

import jcommon.beans4ex.EarthQuake;

import org.apache.commons.collections.Predicate;

public class MajorQuakePredicate implements Predicate {
	
	Float minIntensity;
	Float maxIntensity;

	public MajorQuakePredicate(Float minIntensity, Float maxIntensity) {
		this.minIntensity = minIntensity;
		this.maxIntensity = maxIntensity;
	}
	
	public boolean evaluate(Object object) {
		EarthQuake quake = (EarthQuake)object;
		Float intensity = quake.getIntensity();
		return minIntensity<=intensity && intensity <= maxIntensity;
	}

}
